package cn.kgm.user.dto.dto;

import cn.kgm.core.entity.Entity;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * # 技术改变自己 #
 * 用户登录日志表
 * @author kappi
 * @date   2024-04-08 13:28:48
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "UserLoginLogSaveDTO", description = "用户登录日志表")
public class UserLoginLogSaveDTO extends Entity<Long> {

    /**
     * 用户账号ID:[user_account.id]
     */
    @ApiModelProperty(value = "用户账号ID:[user_account.id]", position = 2)
    @NotNull(message = "用户账号ID:[user_account.id]不能为空")
    private Long accountId;

    /**
     * 请求参数
     */
    @ApiModelProperty(value = "请求参数", position = 3)
    @NotNull(message = "请求参数不能为空")
    private JSON param;

    /**
     * 用户登录IP
     */
    @ApiModelProperty(value = "用户登录IP", position = 4)
    @NotNull(message = "用户登录IP不能为空")
    private Long ipId;

    /**
     * 失败次数
     */
    @ApiModelProperty(value = "失败次数", position = 5)
    @NotNull(message = "失败次数不能为空")
    private Boolean failNum;

    /**
     * log_id没失效前第一次失败时间
     */
    @ApiModelProperty(value = "log_id没失效前第一次失败时间", position = 6)
    @NotNull(message = "log_id没失效前第一次失败时间不能为空")
    private LocalDateTime firstFailTime;

    /**
     * log_id失效时间(登录时间+[user_pass_lock.fail_interval_time])
     */
    @ApiModelProperty(value = "log_id失效时间(登录时间+[user_pass_lock.fail_interval_time])", position = 7)
    @NotNull(message = "log_id失效时间(登录时间+[user_pass_lock.fail_interval_time])不能为空")
    private LocalDateTime deadTime;

}
